package BufferStream;

import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class BufferStream1 {
    public static void main(String[] args)throws IOException {
        FileOutputStream fos = new FileOutputStream("C:\\Users\\啦啦啦\\Desktop\\b.txt",true);
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        //创建一个缓冲流对象
        bos.write("要写入的对象是我".getBytes());
        //将文字导入到bos的内存缓冲区中
        bos.flush();
        //将内容刷入txt文件
        bos.close();
        fos.close();
    }
}
